package class1.s2022350143028.controller;

import base.controller.HomeBaseController;

import java.util.Scanner;

public  class HomeController extends HomeBaseController{
    //登录状态
    //已有属性
    //protected boolean SessionLogin = false;

    //系统主页方法
    public void setSessionLogin(boolean SessionLogin){
         this.SessionLogin=SessionLogin;
    }

    public void main(){
        boolean flag=true;
       while(true){
           System.out.println("----------------------");
           System.out.println("0.退出");
           System.out.println("1.库存管理");
           System.out.println("2.订单管理");
           System.out.println("----------------------");

           Scanner sc = new Scanner(System.in);
           System.out.println("请输入你的选择");
           int choice = sc.nextInt();
           switch (choice){
               case 0:{
                   SessionLogin=false; //退出登录
                   break;
               }
               case 1:{
                   GoodsController goods = new GoodsController();
                   goods.main();
                   break;
               }
               case 2:{
                   OrdersController orders = new OrdersController();
                   orders.main();
                   break;
               }
           }
           if(!SessionLogin){break ;}
       }
       return ;

    }


    //todo 其他方法自行扩展
}
